From: Philip Withnall Date: Fri, 18 Jan 2019 13:22:33 +0000 (+0000) Subject: polkitAgent: Disconnect from user signals when closing dialogue X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2^2~134 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=21de3c327b9e5f4141723c15e75e52c206e71b53;p=gnome-shell.git polkitAgent: Disconnect from user signals when closing dialogue Otherwise the user object could outlive the dialogue, emit a subsequent signal, and the callback from that signal could reference finalised objects/widgets from the dialogue. The likely mechanism for the user outliving the dialogue is caching of user objects within libaccountsservice. This can be triggered by running `pkexec true` from a gnome-terminal window, then calling `pkill pkexec` from another terminal (on a different VT or via SSH). This causes the dialogue to be cancelled by polkitd. Signed-off-by: Philip Withnall https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/357 --- diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index 7f38e122e..dee5f38b3 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -332,6 +332,12 @@ var AuthenticationDialog = new Lang.Class({ Main.sessionMode.disconnect(this._sessionUpdatedId); this._sessionUpdatedId = 0; + if (this._user) { + this._user.disconnect(this._userLoadedId); + this._user.disconnect(this._userChangedId); + this._user = null; + } + this._destroySession(); }, });